@extends('admin/layout')
@section('title','商品管理')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    商品列表
    <small>商品列表</small>
  </h1>
  <ol class="breadcrumb">
  	<li><a href="{{asset('admin/index')}}"><i class="fa fa-th"></i> 管理首页</a></li>
    <li><i class="fa fa-shopping-cart"></i> 商品管理</li>
    <li><a href="{{asset('admin/product')}}"><i class="fa fa-list-ul"></i> 商品列表</a></li>
    <li class="active">商品列表</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-md-12">
      <!-- box start -->
      <div class="box box-info">
      <div class="box-header with-border">
        <h3 class="box-title"><i class="fa fa-list-ul"> 商品列表</i></h3>
      </div>
      @if(session('add_pro_success'))
        <div class="alert alert-success">
          <ul>           
            <li>{{session('add_pro_success')}}</li>
          </ul>
        </div>   
      @endif
      <div class="box-body">
        <div class="row">
          <div class="col-md-3">
            <button onclick="window.location.href='{{asset('admin/product/create')}}'" class="btn bg-orange">添加商品</button>
          </div>
        </div>
        <div class="row">
          &nbsp;
        </div>
        <form class="form-inline" action="{{asset('admin/product')}}" method="get">
          <div class="form-group">
            <label for="inputname" class="">商品关键字</label>&nbsp;
            <input id="inputname" type="text" name="keywords" value="{{$request['keywords'] or ''}}" class="form-control">
          </div>
          <div class="form-group">
            <label>上架状态</label>&nbsp;
            <select class="form-control" name="disabled">
              <option value="1" selected>上架</option>
              <option value="2">下架</option>
            </select>
          </div>
          <!--
          <div class="form-group">
            <label>发布时间</label>&nbsp;
            <select class="form-control">
              <option>降序</option>
              <option>升序</option>
            </select>
          </div>
          <div class="form-group">
            <label>销售数</label>&nbsp;
            <select class="form-control">
              <option>降序</option>
              <option>升序</option>
            </select>
          </div>
          <div class="form-group col-md-offset-1">
            <label>每页条数</label>&nbsp;
            <select class="form-control">
              <option>10</option>
              <option>20</option>
              <option>30</option>
            </select>
          </div>
          -->
          <div class="form-group">
            <button class="btn bg-purple">查询</button>
          </div>
        </form>
        <div class="row">
          &nbsp;
        </div>
        <div class="table-responsive">
        <table id="member_list" class="table table-bordered table-striped text-center">
          <thead>
          <tr>
            <!--<th>选择</th>-->
            <th>序号</th>
            <th>LOGO图片</th>
            <th>商品标题</th>
            <th>商品关键字</th>
            <th>商城价</th>
            <th>发布时间</th>
            <th>新品推荐</th>
            <th>热销推荐</th>
            <th>精品推荐</th>
            <th>上架状态</th>
            <th colspan="1">操作</th>
          </tr>
          </thead>
          <tbody>
          @forelse($data as $v)
          <tr>
            <!--<td><input type="checkbox"></td>-->
            <td>{{$v->product_id}}</td>
            <td><img style="height:40px;" src="/uploads/product/logo_pic/{{$v->logo_pic}}"/></td>
            <td>{{$v->title}}</td>
            <td>{{$v->keyword}}</td>
            <td>￥{{$v->sprice}}</td>
            <td>{{date('Y-m-d H:i:s',$v->rtime)}}</td>
            <td><!--<i class="fa fa-circle text-red"></i> -->
            @if($v->new_recommended==1)
              否
            @elseif($v->new_recommended==2)
              是
            @endif
            </td>
            <td><!--<i class="fa fa-square text-green"></i> -->
            @if($v->hotsell_recommended==1)
              否
            @elseif($v->hotsell_recommended==2)
              是
            @endif
            </td>
            <td><!--<i class="fa fa-square text-green"></i> -->
            @if($v->boutique_recommended==1)
              否
            @elseif($v->boutique_recommended==2)
              是
            @endif
            
            </td>
            <td>
             @if($v->disabled==1)
              上架
            @elseif($v->disabled==2)
              下架
            @endif

            </td>
            <!--
            <td>
              <a href="admin/product/{{$v->product_id}}">
                <button type="button" class="btn-xs btn-success">详情</button>
              </a>
            </td>
            -->
            <td>
              <a href="product/{{$v->product_id}}/edit">
                <button type="button" class="btn-xs btn-warning">详情/更改</button>
              </a>
            </td>
          </tr>
          @empty
          <tr>
            <td colspan="11">当前没有商品</td>
          </tr>
          @endforelse
          </tbody>
          <!--
          <tfoot>
          <tr>
            <th colspan="3">
              <button type="button" class="btn-xs btn-primary">全选</button>
              <button type="button" class="btn-xs btn-primary">不选</button>
              <button type="button" class="btn-xs btn-primary">反选</button>
            </th>
            <th colspan="5"></th>
            <th colspan="3">
              <button type="button" class="btn-xs btn-info">发送全体消息</button>
            </th>
          </tr>
          </tfoot>
          -->
        </table>
         {!!$data ->appends($request) -> render()!!}
        </div>
      </div>

      <!-- /.box-body -->
      <!-- /.box -->        
    </div>

  </div>
</section>
<!-- /.content -->
@stop